<!-- 模板 -->
<template>
    <div class="pop" v-show="show" :class="{'show': isRunAnimation}">
        <transition :name="maskerTransition">
            <div class="pop__masker" v-show="isComponentShow" @click="onHide"></div>
        </transition>
        <div class="pop__inner">
            <transition :name="dialogTransition" v-on:after-leave="afterLeave">
                <div class="pop__inner__dialog" v-show='isComponentShow'>
                    <div class="tip">
                       <img src="../../assets/images/share_winner_bg.png">
                    </div>
                </div>
            </transition>
        </div>
    </div>
</template>


<!-- js -->
<script>
    export default{
       data(){
            return{
                show: !1,
                isRunAnimation: !1,
                isComponentShow: !1,
                maskerTransition: "aui-pop-masker",
                dialogTransition: "aui-pop"
            }
        },
        props: {
            isShow: {
                type: Boolean,
                default: !1
            },
            url: ""
        },
        watch: {
            isShow(){
                if(!this.isShow){
                    this.onHide();
                    return;
                }
                this.show = 1;

                setTimeout(() => {
                    this.isComponentShow = !0;
                }, 10);
            }
        },
        methods: {
            onHide() {
                this.isComponentShow = !1;
            },
            // 点击确认按钮之后，可能会存在回调事件
            afterLeave(){
                this.show = !1;
                // 回调
                this.$emit('on-cb');
            }
        },
        created(){
            setTimeout(() => {
                this.isRunAnimation = !0;
            }, 300);
        }
    }
</script>

<!-- scss -->
<style scoped lang="scss">
    @import "../../styles/views/pop.scss";
    .pop__inner__dialog{
        position: relative;
        overflow: hidden;
        color: #fff;
        pointer-events: auto;
        @include absWin;
        pointer-events: none;
        
    }
    .pop{
        &.show{
            .tip{
                opacity: 1;
                transform: translateY(0);
            }
        }
    }
    .tip{
        width: 100%;
        position: relative;
        opacity: 0;
        transition: all 0.8s cubic-bezier(0.86,0,0.07,1);
        transform: translateY(150px);
        padding-top: 7.2rem;
        >img{
            display: block;
            position: absolute;
            right: 0.5rem;
            width: 6.0rem;
            top: 0.5rem;
        }
    }
</style>
